package main

import (
	"fmt"
	"log"
	testpaper "./client"
	"time"
)

func main() {
	conn, err := testpaper.Connect();
	if(err != nil){
		log.Fatalf("无法连接服务");
	}
	defer conn.Close();

	//result, err := testpaper.DataSync(1)
	//result, err := testpaper.AddUserKnowledge("我是测试","我是测试1123","我是测试","我是测试11",123123,2)
	_,err = testpaper.CreateTestpaper("97e2e933-1db9-41ef-bbe4-4d2ba3fa1181","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
	var t=time.Now().UnixNano()/1e6
	fmt.Printf("开始测试，七名用户循环获取试卷1000次")
	for i:=0;i<100 ;i++  {
		timer1 := time.NewTimer(1000)//每200毫秒获取一次任务
		<-timer1.C
		_,_= testpaper.CreateTestpaper("3747c510-bea5-4906-a59b-4ae402fad5b7","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
		_,_= testpaper.CreateTestpaper("4abfb302-4183-41a6-bf7c-84bce46f7a9a","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
		_,_= testpaper.CreateTestpaper("827e49a6-4178-4302-a7ca-ad73bcd9331a","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
		_,_= testpaper.CreateTestpaper("1c4a80a8-c06b-4d62-a18d-bc719d5d2b1c","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
		_,_= testpaper.CreateTestpaper("87fc04ff-14bf-4c08-b0a6-829e58ea6eef","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
		_,_= testpaper.CreateTestpaper("3fd4230f-7562-4dd3-b2cc-414d14d549a0","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
		_,_= testpaper.CreateTestpaper("1a9d2928-fd7b-47d0-a977-7e8a7b40a775","87489465-25ee-4080-9259-a8d6698da38b","17debc9c-ec04-4a30-9dc8-26c5c0f246a7","04fc446a-f7cd-4bfa-a58e-0062f245b02b",100,35,25,40,50,30,20,1)
	}
	var t2=time.Now().UnixNano()/1e6
	fmt.Printf("总用时:%d\n",t2-t)
	if(err != nil){
		log.Fatalf("远程调用失败",err);
	}

	//log.Println(result)
} 